//
//  imageCell.m
//  结构
//
//  Created by 看着太阳吃烧饼 on 15/7/22.
//  Copyright (c) 2015年 看着太阳吃烧饼. All rights reserved.
//

#import "imageCell.h"
#import "UIImageView+WebCache.h"
#import "imageModal.h"
@implementation imageCell

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self _createSubview];
    }
    return self;
}

- (void)_createSubview {
    _imageView = [[UIImageView alloc] initWithFrame:self.bounds];
    _imageView.layer.cornerRadius = 20;
    _imageView.layer.borderWidth = 1;
    _imageView.layer.masksToBounds = YES;
    _imageView.layer.borderColor = [UIColor whiteColor].CGColor;
    [self.contentView addSubview:_imageView];
}

- (void)setModal:(imageModal *)modal {
    _modal = modal;
    [self setNeedsLayout];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [_imageView sd_setImageWithURL:[NSURL URLWithString:_modal.image]];
    
}
@end
